// 计算样式
const computedSize = () => {
  let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
  let clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
  let option = {};

  // 14寸笔记本
  if (clientWidth <= 1366) {
    console.log("14寸笔记本")
    option.media = '14寸笔记本';
    option.roseSubTitleFont = 12;
    option.roseLegendFont = 12;
    option.fontSize = 12; //文字大小
    option.symbolSize = 3; //节点大小
    option.borderWidth = 1; //线条宽度
    option.itemWidth = 12; //legend方块宽度
    option.itemHeight = 5; //legend方块高度
    option.padding = [0, 50, 0, 0]; //右侧单位距离右侧距离
    option.grid = {
        containLabel: true,
        bottom: "6%",
        top: "25%",
        left: "2%",
        right: "2%",
    };
      
  } // 全高清屏幕
  else if (clientWidth <= 1920) {
      console.log("全高清屏幕")
      option.media = '1920P';
      option.roseTitleFontsize = 20;
      option.roseSubTitleFont = 12;
      option.roseLegendFont = 12;
      option.fontSize = 14; //文字大小
      option.symbolSize = 5; //节点大小
      option.borderWidth = 2; //线条宽度
      option.itemWidth = 20; //legend方块宽度
      option.itemHeight = 8; //legend方块高度
      option.padding = [0, 55, 0, 0]; //右侧单位距离右侧距离
      option.grid = {
          containLabel: true,
          bottom: "6%",
          top: "25%",
          left: "2%",
          right: "2%",
      };
  }
  // 2K
  else if (clientWidth <= 2560) {
      console.log("2K")
      option.media = '2K';
      option.roseTitleFontsize = 36;
      option.roseSubTitleFont = 22;
      option.roseLegendFont = 18;
      option.fontSize = 18; //文字大小
      option.symbolSize = 10; //节点大小
      option.borderWidth = 3; //线条宽度
      option.itemWidth = 25; //legend方块宽度
      option.itemHeight = 10; //legend方块高度
      option.padding = [0, 50, 0, 0]; //右侧单位距离右侧距离
      option.grid = {
          containLabel: true,
          bottom: "6%",
          top: "20%",
          left: "2%",
          right: "2%",
      };
  }
   // 4K 带鱼屏
   else if (clientWidth <= 3840 && clientHeight <= 1080) {
      console.log("4K 带鱼屏")
      option.media = '4K带鱼屏';
      option.roseTitleFontsize = 36;
      option.roseSubTitleFont = 22;
      option.roseLegendFont = 18;
      option.fontSize = 20; //文字大小
      option.symbolSize = 15; //节点大小
      option.borderWidth = 5; //线条宽度
      option.itemWidth = 24; //legend方块宽度
      option.itemHeight = 15; //legend方块高度
      option.padding = [0, 60, 0, 0]; //右侧单位距离右侧距离
      option.grid = {
          containLabel: true,
          bottom: "6%",
          top: "28%",
          left: "2%",
          right: "2%",
      };
  }
  // 4K
  else if (clientWidth <= 3840 && clientHeight >= 1080) {
      console.log("4K尺寸")
      option.media = '4K';
      option.roseTitleFontsize = 36;
      option.roseSubTitleFont = 22;
      option.roseLegendFont = 18;
      option.fontSize = 30; //文字大小
      option.symbolSize = 20; //节点大小
      option.borderWidth = 5; //线条宽度
      option.itemWidth = 40; //legend方块宽度
      option.itemHeight = 20; //legend方块高度
      option.padding = [0, 150, 0, 0]; //右侧单位距离右侧距离
      option.grid = {
          containLabel: true,
          bottom: "6%",
          top: "18%",
          left: "2%",
          right: "2%",
      };
  } 

  return option;
};

export { computedSize };